From 20fd4b70a7647656812b8f276510e09b252db9f7 Mon Sep 17 00:00:00 2001 From: Eugene Korenevsky Date: Mon, 4 May 2015 11:56:21 +0200 Subject: [PATCH] test_x86_emulate: extend EFLAGS check of CMPXCHG test CMPXCHG: in the case of inequality of the rAX and the operand, need to check CF, PF, AF, SF and OF flags as well. This adjustment covers the fix of incorrect comparison during CMPXCHG emulation. Signed-off-by: Eugene Korenevsky --- tools/tests/x86_emulator/test_x86_emulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tests/x86_emulator/test_x86_emulator.c b/tools/tests/x86_emulator/test_x86_emulator.c index 66d5eff163..b789edf0ca 100644 --- a/tools/tests/x86_emulator/test_x86_emulator.c +++ b/tools/tests/x86_emulator/test_x86_emulator.c @@ -288,7 +288,7 @@ int main(int argc, char **argv) rc = x86_emulate(&ctxt, &emulops); if ( (rc != X86EMUL_OKAY) || (*res != 0x923456AA) || - ((regs.eflags&0x240) != 0x200) || + ((regs.eflags&0xad5) != 0xa91) || (regs.eax != 0xAABBCCAA) || (regs.ecx != 0xFF) || (regs.eip != (unsigned long)&instr[4]) ) -- 2.30.2